import os
from plistlib import InvalidFileException

import pytest
from openpyxl import load_workbook
class ExcelLoginData:
    @staticmethod
    def read_login_data(filename,sheet):
        try:
            wb = load_workbook(filename=filename)
            st = wb[sheet]
            data = [[st.cell(row=i, column=j).value for j in range(1, st.max_column + 1)] for i in range(2, st.max_row + 1)]
            return data
        except Exception as e:
            print('文件操作有问题',e)
        finally:
            wb.save(filename)

# if __name__ == '__main__':
    # data1 = ExcelLoginData.read_login_data('login.xlsx','Sheet1')
    # print("data1:", data1)





